POV-Ray : Newsgroups : povray.general : Even distribution on a sphere : Re: Even distribution on a sphere Server Time
5 Aug 2024 08:22:34 EDT (-0400)
  Re: Even distribution on a sphere  
From: Tim Nikias
Date: 15 Oct 2002 07:24:08
Message: <3dabfad8@news.povray.org>
I've come across the same problem some time ago,
so I implemented a macro which calculated an
electrostatic-repulsion algorithm. Some animations of
this macro can be found on my website.

If you want the code, I can see if I have to clean
the code a little or if I can send it to you right
away, just give me an email-adress.

Regards,
Tim


--
Tim Nikias
Homepage: http://www.digitaltwilight.de/no_lights/index.html
Email: Tim### [at] gmxde

> Okay, I'm trying to randomly distribute objects, using trace, on a sphere.
>
> So, I do something like:
>
> RotZ = 180*rand(R1)
> RotY = 360*rand(R1)
> Trans = transform(translate y*10 rotate z*RotZ rotate y*RotY)
> TVec = vtransform(<0,0,0>, Trans)
> Inter = trace(Ob, TVec, -TVec)
>
>
> The trouble is that I end up with a bunching of objects at the poles for
all the
> obvious reasons, so the question is, how do I best avoid this? I assume
it's
> something like:
> ZRotFac = 1 + pow(abs((ZRot/90)-1),2);
> ZRot = ZRot * ZRotFac
>
> But,
>
> a) is this correct? (well, it's not, afaik - the range 1..2 is too limited
imho)
> b) if not, what is?
>


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.